using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Helper;
namespace CoreData
{
    public class Receipt_VoucherLocal
    {
            public long ID{get;set;}
            public string Payer{get;set;}
            public string Address { get; set; }
            public long VoucherID{get;set;}
            public int Money{get;set;}
            public bool IsDeleted{get;set;}

            public Receipt_VoucherLocal()
        {       
                            Payer ="";   
        }

            static Receipt_VoucherLocal DynamicCast<T>(object row_data, object row_header) where T : Receipt_VoucherLocal
       {
           // row_data : DataRow
           // row_header : DataColumnCollection
           Receipt_VoucherLocal ret = new Receipt_VoucherLocal();
           DataRow dt = (DataRow)row_data;

           foreach (DataColumn column in (DataColumnCollection)row_header)
           {
               switch (column.ColumnName)
               {
                      case  "ID":
                        ret.ID = ConvertObject.ToLong(dt[column]);
                       break;
                      case  "Payer":
                        ret.Payer = ConvertObject.ToString(dt[column]);
                       break;
                      case  "VoucherID":
                        ret.VoucherID = ConvertObject.ToLong(dt[column]);
                       break;
                      case  "Money":
                        ret.Money = ConvertObject.ToInt(dt[column]);
                       break;
                      case  "IsDeleted":
                        ret.IsDeleted = ConvertObject.ToBool(dt[column]);
                       break;
                      case "Address": ret.Address = ConvertObject.ToString(dt[column]);
                       break;
                   default:
                       break;
               }
           }

           return ret;
       }
        
    }
}
